local function main(userOb,msgData)
    local weapon = ITEM_D:find_weapon_by_level(userOb:get_level())
    if not weapon or weapon.type ~= "weapon" then
        local result = {}
        result.code = 400
        userOb:send_packet("MSGS2CGoldUp", result)
        return
    end

    local item_price_value = weapon.coinPurchase
    if msgData.double and msgData.double > 0 then
        item_price_value = item_price_value * 2
    end

    userOb:add_currency(GamePropIds.kGamePropIdsCopperIcon, item_price_value)

    local result = {}
    result.code = 200
    result.isdouble = msgData.double
    userOb:send_packet("MSGS2CGoldUp", result)
    ITEM_D:send_currency_info(userOb)
end

COMMAND_D:register_command("MSGC2SGoldUp",GameCmdType.NONE, main)
